import pytest
from base.baseAPI import BaseAPI
from confige import *
from baseTools.myLogger import logger

@pytest.fixture(scope="session")
def get_token():
    params = {
        "corpid": corpid,
        "corpsecret": corpsecret
    }
    logger.info("获取通讯录模块接口请求的access_token")
    token_rep = BaseAPI().my_get(url=url+'/cgi-bin/gettoken', data=params)
    token = token_rep.get('access_token')
    logger.info(f"token获取成功，值为：{token}")
    return token